<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchFormDict").submit();
        return false;
    }
    function refresh(){
        $("#applyOn").val('');
        $("#patientId").val('');
        $("#searchFormDict").submit();
    }
</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-4">
            <div class="content-wrap" id="leftCenterDiv">
                <ul class="nav nav-tabs">
                    <li class="active">
                        <a href="#">手术待发药</a>
                    </li>
                </ul>

                <%--左侧药品字典列表--%>
                <section class="panel panel-default">
                    <div class="panel-body">
                        <div class="table-responsive no-border">
                            <div class="datatable-top">
                                <div class="pull-left">
                                    <%--处方查询--%>
                                    <form:form id="searchFormDict" modelAttribute="prescriptionApply"
                                               onsubmit="return loadDivForm('mainCenterDiv','searchFormDict','${ctx}/doctor/prescriptionApply/findByOperation');"
                                               method="post" class="form-inline">
                                        <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                        <input id="pageSize" name="pageSize" type="hidden"
                                               value="${page.pageSize}"/>
                                        <label>住院号:</label><form:input path="clinicNo" htmlEscape="false" maxlength="50" class="form-control"/>
                                        &nbsp;&nbsp;</br>
                                        <label>领药人:</label><form:input path="patientId" htmlEscape="false"  maxlength="50" class="form-control"/>

                                        <input id="btnSubmit" class="btn btn-primary" type="button" onclick="refresh()" value="刷新"/>
                                        <input id="btnSubmit1" class="btn btn-primary" type="submit" value="查询"/>
                                    </form:form>
                                </div>
                            </div>

                            <%--药品名称列表--%>
                            <div class="container-fluid">
                                <table id="contentTable1" class="table table-bordered mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>住院号</th>
                                        <th>领药人</th>
                                        <th>处方属性</th>
                                        <th>开方时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${page.list}" var="prescriptionApply">
                                    <tr onclick="loadDiv('rightCenterDiv','${ctx}/doctor/prescriptionItem/findOperationApplyId?applyId=${prescriptionApply.id}')">
                                        <td> ${prescriptionApply.clinicNo}</td>
                                        <td> ${prescriptionApply.patientId}</td>
                                        <td>${fns:getDictLabel(prescriptionApply.prescAttr, 'DRUG_PRESC_ATTR_DICT', '')}</td>
                                        <td><fmt:formatDate value="${prescriptionApply.createDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                    </tr>
                                    </c:forEach>
                                </table>
                                <div class="pagination">${page}</div>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </section>

        <%--右侧药品规格字典列表--%>
        <section class="main-content col-lg-8">
            <div class="content-wrap" id="rightCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#">领药单详情</a>
                        </li>
                        <li>
                            <a href="#" onclick="loadDiv('rightCenterDiv','${ctx}/operation/operationCost/operationCostCreateList')">生成领药单</a>
                        </li>
                    </ul>
                </div>
            </div>
        </section>
    </section>
</div>

